package com.zz.stringBuilder;

public class Case {
    public static void main(String args[]){
        System.out.println(getArrayData(new int[]{11, 12, 12 ,2}));
    }

    public static String getArrayData(int[] arr){
        if(arr == null){
            return null;
        }
        StringBuilder s = new StringBuilder();
        s.append("[");
        for(int i = 0;i < arr.length;i++){
            if(arr.length-1 == i){
                s.append(arr[i]);
            }else{
                s.append(arr[i]).append(", ");
            }
        }
        s.append("]");
        return s.toString();
    }
}
